package com.tool.spring.dao;

import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @Author: lixiaofei
 */
public class UserDaoImpl implements  UserDao {

    private JdbcTemplate jdbcTemplate;

    public JdbcTemplate getJdbcTemplate() {
        return jdbcTemplate;
    }

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    @Override
    public int insertUser(String username, String password) {
        String sql = "insert into user(username,password) value('"+username+"','"+password+"')";
        int i = jdbcTemplate.update(sql);
//        int i = jdbcTemplate.update(sql, username, password);
        System.out.println("UserDao的返回值：" + i);
        //runTime();
        return i;
    }


}
